package com.xps.and.yuntong.Data;

/**
 * 城市属性实体类
 *
 * @author gugalor
 */
public class CityModel implements Comparable<CityModel> {
    private String CityName; //城市名字
    private String NameSort; //城市首字母

    public String getCityName() {
        return CityName;
    }

    public void setCityName(String cityName) {
        CityName = cityName;
    }

    public String getNameSort() {
        return NameSort;
    }

    public void setNameSort(String nameSort) {
        NameSort = nameSort;
    }

    @Override
    public int compareTo(CityModel another) {
        char c = NameSort.charAt(0);
        char ac = another.getNameSort().charAt(0);

        if (c > another.getNameSort().charAt(0)) {
            return 1;
        } else if(c <another.getNameSort().charAt(0)) {
            return -1;
        }else return 0;
    }

    @Override
    public String toString() {
        return "CityModel{" +
                "CityName='" + CityName + '\'' +
                ", NameSort='" + NameSort + '\'' +
                '}';
    }
}
